import Vue from 'vue'
import Router from 'vue-router'
//导入组件
import HelloWorld from '@/components/HelloWorld'
import Login from '@/views/Login/login'
import Index from '@/views/Index/Index'
import Welcome from '@/views/Index/Welcome'
import User from '@/views/User/User'
import Role from '@/views/Auth/Role'
import Auth from '@/views/Auth/Auth'
import Category from '@/views/Good/Category'
import Goods from '@/views/Good/Good'
import GoodsAdd from '@/views/Good/GoodsAdd'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children:[
        {
          path:'/welcome',
          name:'Welcome',
          component:Welcome
        },
        {
          path:'/users',
          name:'User',
          component:User
        }, 
        {
          path:'/roles',
          name:'Role',
          component:Role
        },
        {
          path:'/rights',
          name:'Auth',
          component:Auth
        },
        {
          path:'/goods',
          name:'Goods',
          component:Goods
        },
        {
          path:'goodsAdd',
          name:'GoodsAdd',
          component:GoodsAdd
        },
        {
          path:'/categories',
          name:'Category',
          component:Category
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
   
  ]
})
